package top.alanshelby.mybatis.bean;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Employee {

    private Integer empNo;

    private String eName;

    private String job;

    private Integer mgr;

    private Double sal;

    private Double comm;

    private Integer deptNo;

    private Date hireDate;

    private Integer workAge;

    public Employee() {
    }

    public Employee(Date tempDate) {
        this.hireDate = tempDate;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
        this.workAge = Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(this.hireDate));
    }

    public Integer getEmpNo() {
        return empNo;
    }

    public void setEmpNo(Integer empNo) {
        this.empNo = empNo;
    }

    public String geteName() {
        return eName;
    }

    public void seteName(String eName) {
        this.eName = eName;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public Integer getMgr() {
        return mgr;
    }

    public void setMgr(Integer mgr) {
        this.mgr = mgr;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }

    public Double getComm() {
        return comm;
    }

    public void setComm(Double comm) {
        this.comm = comm;
    }

    public Integer getDeptNo() {
        return deptNo;
    }

    public void setDeptNo(Integer deptNo) {
        this.deptNo = deptNo;
    }

    public Date getHireDate() {
        return hireDate;
    }

    public void setHireDate(Date hireDate) {
        this.hireDate = hireDate;
    }

    public Integer getWorkAge() {
        return workAge;
    }

    public void setWorkAge(Integer workAge) {
        this.workAge = workAge;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "empNo=" + empNo +
                ", eName='" + eName + '\'' +
                ", job='" + job + '\'' +
                ", mgr=" + mgr +
                ", sal=" + sal +
                ", comm=" + comm +
                ", deptNo=" + deptNo +
                ", hireDate=" + hireDate +
                ", workAge=" + workAge +
                '}';
    }
}
